<?php
require('header.php');
?>
    <h1>Reference reading</h1>
      <hr>
      <a class="btn btn-success" href="add_tech.php">
        <i class="icon-plus-sign icon-white"></i> Add new technology
      </a>
      <a class="btn btn-info" href="add_refer.php">
        <i class="icon-plus-sign icon-white"></i> Add new reference
      </a>
      <hr>

      <?php
      if(isset($_REQUEST['t'])) {
        $t=$_REQUEST['t'];
        $sql="SELECT * FROM reference, technology WHERE technology.tech_id=reference.tech_id AND technology.tech_id=$t";
        $result=mysql_query($sql) or die('Reference reading retrievel failed.');
        generate_tabs($result);
      } else {
        // Show all technologies from DB
        $sql = "SELECT * FROM technology";
        $result=mysql_query($sql) or die('Could not find technologies from database.');
        generate_tech_table($result);
      }
      ?>

    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="assets/js/jquery.js"></script>
    <script src="assets/js/bootstrap-transition.js"></script>
    <script src="assets/js/bootstrap-alert.js"></script>
    <script src="assets/js/bootstrap-modal.js"></script>
    <script src="assets/js/bootstrap-dropdown.js"></script>
    <script src="assets/js/bootstrap-scrollspy.js"></script>
    <script src="assets/js/bootstrap-tab.js"></script>
    <script src="assets/js/bootstrap-tooltip.js"></script>
    <script src="assets/js/bootstrap-popover.js"></script>
    <script src="assets/js/bootstrap-button.js"></script>
    <script src="assets/js/bootstrap-collapse.js"></script>
    <script src="assets/js/bootstrap-carousel.js"></script>
    <script src="assets/js/bootstrap-typeahead.js"></script>
    <script>
    $(function () {
      $('.tabs a:last').tab('show')
    });
    </script>

  </body>
</html>
